<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
use Closure;
use Illuminate\Support\Facades\Route;

class VerifyCsrfToken extends Middleware
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        'common/pay/*',
        'houdunren/wechat/*'
    ];

    //自定义以路由名称 排除
//    protected $routes = [
//        'common.pay.async'
//    ];

//    //重写handle方法
//    public function handle($request, Closure $next)
//    {
//    //条件
//        if (in_array(Route::currentRouteName(), $this->routes)) {
//            return $next($request);
//        }
//        //如果不是，调用父级中间件。
//        return parent::handle($request,$next);
//    }

}
